﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;

namespace RecipeManager
{
    public class FilterItem : INotifyPropertyChanged
    {
        #region Constructor

        public FilterItem()
        {

        }

        #endregion

        #region FilterType

        private string _filterType = "Name";

        protected static readonly PropertyChangedEventArgs FilterTypePropertyChangedEventArgs = new PropertyChangedEventArgs("FilterType");

        public string FilterType
        {
            get
            {
                return _filterType;
            }
            set
            {
                if (_filterType != value)
                {
                    _filterType = value;
                    OnPropertyChanged(FilterTypePropertyChangedEventArgs);
                }
            }
        }

        #endregion

        #region Value

        private string _value = "";

        protected static readonly PropertyChangedEventArgs ValuePropertyChangedEventArgs = new PropertyChangedEventArgs("Value");

        public string Value
        {
            get
            {
                return _value;
            }
            set
            {
                if (_value != value)
                {
                    _value = value;
                    OnPropertyChanged(ValuePropertyChangedEventArgs);
                }
            }
        }

        #endregion

        #region INotifyPropertyChanged Members

        public event PropertyChangedEventHandler PropertyChanged;

        protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, e);
            }
        }

        #endregion
    }
}
